package com.springboot.jdk.lock;

import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * 读锁
 *
 * @author: zr
 * @date: 2021-10-02
 */
public class ReentrantReadWriteLockDemo {

    public static void main(String[] args) {
        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
        lock.readLock().lock();
        lock.writeLock().lock();

        lock.readLock().unlock();
        lock.writeLock().unlock();

    }
}
